package com.rd.student.dashuju.zhengruixian;
import java.util.LinkedList;
public class LinkList {
    public static void main(String[] args) {
        LinkedList list = new LinkedList();
        list.add(new Student1("郑睿娴", "数据专业", "数据21-1班"));
        list.add(new Student1("孙文卓", "数据专业", "数据21-1班"));
        list.add(new Student1("王博", "数据专业", "数据21-3班"));
        list.add(new Student1("王高博,", "物联专业", "物联21-3班"));
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
//

    }
    }
    class Student1{
        private String name;
        private String major;
        private String class1;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getMajor() {
            return major;
        }

        public void setMajor(String major) {
            this.major = major;
        }

        public String getClass1() {
            return class1;
        }

        public void setClass1(String class1) {
            this.class1 = class1;
        }

        public Student1(){

        }


        public Student1(String name, String major, String class1){
            this.name=name;
            this.major=major;
            this.class1=class1;
        }

        @Override
        public String toString(){
          return "姓名:"+name+",专业:"+major+",班级:"+class1;
        }
//@Override
//public String toString() {
//    return "Student{" +
//            "name='" + name + '\'' +
//            ", major='" + major + '\'' +
//            ", class=" + class1 +
//            '}';}


    }



